/*
 * TCPSocket.h
 *
 *  Created on: Oct 4, 2012
 *      Author: eric
 */

#ifndef TCPSOCKET_H_
#define TCPSOCKET_H_

#include <sys/socket.h>   	// socket(), connect(), send(), and recv()
#include <sys/types.h>		// Sock_stream
#include <stdlib.h>			// exit
#include <stdio.h>
#include <arpa/inet.h>
#include <netinet/in.h>      // For sockaddr_in
#include <iostream>

using namespace std;

class TCPSocket {
public:
	TCPSocket(unsigned short int portNumber, int QueueLength);
	virtual ~TCPSocket();

private:
	void throwError(const char msg[]) const;
	void bindSocket(unsigned short int portNr);

	// Variables
	int mainSocket;
};

#endif
